<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <body>

        <ui:composition template="./TemplatePrincipal.xhtml">

            <ui:define name="left">
                left
            </ui:define>

            <ui:define name="right">
                right
            </ui:define>

            <ui:define name="content">
                <f:view>
                    <center><h:panelGrid columns="3">
                            <h:outputLabel value=""/>
                            <p:panel header="Agregar / Editar DOCUMENTACIÓN">  
                                        
                                        <h:form enctype="multipart/form-data">
                                           <h:panelGrid columns="5">
                                                <h:outputText value="A.Nacimiento :"/>
                                                <h:outputLabel value="     "/>
                                                <p:fileUpload fileUploadListener="#{documentBean.handleFileUpload}"  
                                                              update="img,messages"  
                                                              auto="true"   
                                                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
                                                <p:growl id="messages" showDetail="true"/>
                                                <p:graphicImage id="img" value="#{documentBean.img}" width="40" height="40"/>

                                                </h:panelGrid>
                                        </h:form>

                                        <h:form enctype="multipart/form-data">
                                            <h:panelGrid columns="5">
      
                                                <h:outputText value="C.Estudios :"/>
                                                <h:outputLabel value="            "/>
                                                <p:fileUpload fileUploadListener="#{documentBean.handleFileUpload1}"  
                                                              update="img,messages"  
                                                              auto="true"   
                                                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
                                                <p:growl id="messages" showDetail="true"/>
                                                <p:graphicImage id="img" value="#{documentBean.img1}" width="40" height="40"/>

                                                </h:panelGrid>
                                        </h:form>


                                        <h:form enctype="multipart/form-data">
                                             <h:panelGrid columns="5">
                                                <h:outputText value="C.Domicilio :"/>
                                                <h:outputLabel value="          "/>
                                                <p:fileUpload fileUploadListener="#{documentBean.handleFileUpload2}"  
                                                              update="img,messages"  
                                                              auto="true"   
                                                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
                                                <p:growl id="messages" showDetail="true"/>
                                                <p:graphicImage id="img" value="#{documentBean.img2}" width="40" height="40"/>

                                                </h:panelGrid> 
                                        </h:form>


                                        <h:form enctype="multipart/form-data">
                                              <h:panelGrid columns="5">
                                                <h:outputText value="CURP:"/>
                                                <h:outputLabel value="                      "/>
                                                <p:fileUpload fileUploadListener="#{documentBean.handleFileUpload3}"  
                                                              update="img,messages"  
                                                              auto="true"   
                                                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
                                                <p:growl id="messages" showDetail="true"/>
                                                <p:graphicImage id="img" value="#{documentBean.img3}" width="40" height="40"/>

                                                </h:panelGrid> 
                                        </h:form>

                                        <h:form enctype="multipart/form-data">
                                              <h:panelGrid columns="5">
                                                <h:outputText value="Fotos:"/>
                                                <h:outputLabel value="                       "/>
                                                <p:fileUpload fileUploadListener="#{documentBean.handleFileUpload4}"  
                                                              update="img,messages"  
                                                              auto="true"   
                                                              allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>  
                                                <p:growl id="messages" showDetail="true"/>
                                                <p:graphicImage id="img" value="#{documentBean.img4}" width="40" height="40"/>

                                                </h:panelGrid> 
                                        </h:form>
                                                          
                                      <h:form>
                                        <p:growl/>
                                        <h:panelGrid columns="2">
                                        
                                        <h:outputLabel value="Observaciones:" for="observaciones" />
                                        <p:inputText id="observaciones" value="#{documentBean.document.observaciones}" title="Observaciones">
                                            <f:validateRegex pattern="[a-zA-Z\s]{0,45}"/>
                                        </p:inputText>

                                        <h:outputLabel value="Usuario:" for="Usuario" />
                                        <p:selectOneMenu id="idUsuario" value="#{documentBean.idUsuarioSeleccionado}" title="IdUsuario" required="true" requiredMessage="The IdUsuario field is required.">
                                            <!-- TODO: update below reference to list of available items-->
                                            <f:selectItems value="#{documentBean.listUsuario}" var="item" itemValue="#{item.id}"/>
                                        </p:selectOneMenu>
                                    </h:panelGrid>
                                    <center><p:commandButton action="#{documentBean.prepararUsuario}" value="Aceptar" ajax="false"/>
                                        <p:commandButton action="Documentacion" value="Cancelar" immediate="true" ajax="false"/>
                                    </center>
                                </h:form>
                            </p:panel>
                            <h:outputLabel value=""/>
                        </h:panelGrid></center>
                </f:view>

            </ui:define>

        </ui:composition>

    </body>
</html>
